package com.task.core.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

import com.task.common.domain.info.KeyAndValue;
import com.task.core.domain.AffiliateInfo;
import com.task.core.dto.request.AffiliateRequestDTO;

/**
 * @author 迪迦.
 * @date 2024/10/30 15:09
 */
@Mapper
public interface AffiliateMapper {

  List<AffiliateInfo> getAffiliateByPage(AffiliateRequestDTO request);

  AffiliateInfo getAffiliateByCodeOrName(@Param("code") String code, @Param("name") String name);

  List<KeyAndValue> getAffiliateForOption(AffiliateRequestDTO request);

  void addAffiliate(AffiliateRequestDTO request);

  Integer modifyAffiliate(AffiliateRequestDTO request);

  Integer deleteAffiliate(@Param("code") String affiliateCode, @Param("userId") Long userId);

  Integer getUsedCount(@Param("code")String affiliateCode);

    AffiliateInfo getAffiliateByCode(AffiliateRequestDTO affiliateInfo);
}
